package com.lfk.justweengine.utils.tool;

import com.lfk.justweengine.utils.tools.ServiceUtils;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.aafwk.content.Intent;
import ohos.app.Context;
import org.junit.Assert;
import org.junit.Test;


public class ServiceUtilsOhosTest {

    private String iconFilePath = "resources/rawfile/graphic/icon.png";

    @Test
    public void testIsServiceRunning() {
        Context context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        Assert.assertTrue(ServiceUtils.isServiceRunning(context,"com.lfk.justweengine"));
    }

    @Test
    public void testStartService() {
        Context context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        Intent in = new Intent();
        ServiceUtils.startService(context, ServiceUtilsOhosTest.class,in);
        Assert.assertTrue(true);
    }

    @Test
    public void testStopService() {
        Context context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        Intent in = new Intent();
        ServiceUtils.stopService(context, ServiceUtilsOhosTest.class);
        Assert.assertTrue(true);
    }


}